package thinkingJava.chapter12;

class ThreeException extends Exception {}

public class FinallyWorks {
	static int counter = 0;
	public static void main(String[] args) {
		while(true) {
			try {
				if (counter++ == 0) {
					throw new ThreeException();
				}
				System.out.println("no Exception");
			} catch (ThreeException e) {
				System.out.println("three Exception");
			} finally {
				System.out.println("in finally clause");
				if (counter == 2) {
					break;
				}
			}

		}
	}
}
